<template>
	<view class="">
		<view class="title">
			{{title}}
		</view>
		<view class="list">
			<view class="li" v-for="(val, index) of list" :key="index">
				<image :src="val.path" mode="aspectFit"></image>
				<view>{{val.name}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapMutations
	} from 'vuex';
	import CHONG from '../../static/js/function.js';
	export default {
		computed: { ...mapState(['URL', 'TOKEN'])
		},
		data() {
			return {
				title: '',
				list: []
			}
		},
		methods:{
			getlist(){
				uni.request({
					url: this.URL + 'prohibitList',
					success: res => {
						console.log(res.data);
						// if (res.data.success) {
							this.list = res.data;
						// } else {
							// CHONG.tip('网路错误，请稍后再试');
						// }
					}
				});
			},
			getTitle(){
				uni.request({
					url: this.URL + 'prohibitE',
					success: res => {
						console.log(res.data);
						if (res.data.success) {
							this.title = res.data.data[0]['name'];
						} else {
							CHONG.tip('网路错误，请稍后再试');
						}
					}
				});
			}
		},
		mounted() {
			this.getlist();
			this.getTitle();
		},
	}
</script>

<style>
	.title {
		padding: 10upx 25upx;
		font-size: 22upx;
		text-indent: 2em;
	}

	.list {
		display: flex;
		flex-wrap: wrap;
	}

	.list .li {
		width: 33.3%;
		height: 300upx;
		font-size: 30upx;
		text-align: center;
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.list .li image {
		width: 90%;
		height: 90%;
	}
</style>
